/*
 /*
 * Classname Messages
 *
 * Version information
 *
 * Date Feb 20, 2006
 * Copyright (c) AmSoft Systems, 2006
 */
package net.amsoft.iservice.isso.util;

import java.util.MissingResourceException;
import java.util.ResourceBundle;
/**
 * @author mohit
 */
public class Messages
{
	private static final String BUNDLE_NAME = "messages";//$NON-NLS-1$
	private static final String BUNDLE_NAME_SERVICE = "serviceMessages";

	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
			.getBundle(BUNDLE_NAME);

	private static final ResourceBundle RESOURCE_BUNDLE_SERVICE = 
		ResourceBundle.getBundle(BUNDLE_NAME_SERVICE);

	public static final String DATABASE_NAME = RESOURCE_BUNDLE
			.getString("database.name");
	public static final String DATABASE_USER = RESOURCE_BUNDLE
			.getString("database.user");
	public static final String DATABASE_URL = RESOURCE_BUNDLE
			.getString("database.url");

	private Messages()
	{
	}
	public static String getString(String key)
	{
		try
		{
			return RESOURCE_BUNDLE.getString(key);
		} catch (MissingResourceException e)
		{
			return '!' + key + '!';
		}
	}

	public static String getStr(String key)
	{
		try
		{
			return RESOURCE_BUNDLE_SERVICE.getString(key);
		} catch (MissingResourceException e)
		{
			return '!' + key + '!';
		}
	}
}